import Vue from 'vue';
import VueRouter from 'vue-router';
import ProductList from '../components/ProductList.vue';
import ShoppingCart from '../components/ShoppingCart.vue';
import UserLogin from '../components/UserLogin.vue';
import UserRegister from '../components/UserRegister.vue';
import ProductDetail from '../components/ProductDetail.vue';
import UserWishlist from '../components/UserWishlist.vue';
import OrderList from '../components/OrderList.vue';
import OrderDetail from '../components/OrderDetail.vue';
Vue.use(VueRouter);

const routes = [
  { path: '/products', component: ProductList },
  { path: '/cart', component: ShoppingCart },
  { path: '/login', component: UserLogin },
  { path: '/register', component: UserRegister },
  { path: '/product/:id', component: ProductDetail },
  { path: '/wishlist', component: UserWishlist },
  { path: '/orders', component: OrderList },
  { path: '/order/:id', component: OrderDetail },
];

const router = new VueRouter({
  mode: 'history',
  routes,
});

export default router;